<html>
<head><meta charset="utf-8"><title>const Eq &amp;str · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html">const Eq &amp;str</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200106523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200106523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200106523">(Jun 08 2020 at 14:39)</a>:</h4>
<p><code>"" == "" //~  [rustc E0015] [E] calls in constant functions are limited to constant functions, tuple structs and tuple variants</code><br>
Is this currently possible, will it ever work, why not?</p>



<a name="200109592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200109592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200109592">(Jun 08 2020 at 14:59)</a>:</h4>
<p>It's currently not possible</p>



<a name="200109622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200109622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200109622">(Jun 08 2020 at 14:59)</a>:</h4>
<p>it will work at some point</p>



<a name="200109738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200109738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200109738">(Jun 08 2020 at 15:00)</a>:</h4>
<p>The relevant RFC: <a href="https://github.com/rust-lang/rfcs/pull/2632">https://github.com/rust-lang/rfcs/pull/2632</a></p>



<a name="200109904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200109904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200109904">(Jun 08 2020 at 15:01)</a>:</h4>
<p>it's actually possible to make your case work on nightly already, all the code is there, the problem is that we have no way to mark the <code>PartialEq</code> impl on <code>&amp;str</code> to be unstably const. We have to insta-stabilize with the current setup</p>



<a name="200109961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/const%20Eq%20%26str/near/200109961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/const.20Eq.20.26str.html#200109961">(Jun 08 2020 at 15:01)</a>:</h4>
<p>I'm not sure if it's possible to create a setup where insta-stabilization isn't necessary</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>